home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / NFSD / XDR3.H < prev   
C/C++ Source or Header  |  1999-09-17  |  6KB  |  269 lines

  1. /*
  2.  * linux/include/linux/nfsd/xdr3.h
  3.  *
  4.  * XDR types for NFSv3 in nfsd.
  5.  *
  6.  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  7.  */
  8.  
  9. #ifndef LINUX_NFSD_XDR3_H
  10. #define LINUX_NFSD_XDR3_H
  11.  
  12. #include <linux/nfsd/xdr.h>
  13.  
  14. struct nfsd3_sattrargs {
  15.     struct svc_fh        fh;
  16.     struct iattr        attrs;
  17.     time_t            guardtime;
  18. };
  19.  
  20. struct nfsd3_diropargs {
  21.     struct svc_fh        fh;
  22.     char *            name;
  23.     int            len;
  24. };
  25.  
  26. struct nfsd3_accessargs {
  27.     struct svc_fh        fh;
  28.     unsigned int        access;
  29. };
  30.  
  31. struct nfsd3_readargs {
  32.     struct svc_fh        fh;
  33.     __u64            offset;
  34.     __u32            count;
  35. };
  36.  
  37. struct nfsd3_writeargs {
  38.     svc_fh            fh;
  39.     __u64            offset;
  40.     __u32            count;
  41.     int            stable;
  42.     __u8 *            data;
  43.     int            len;
  44. };
  45.  
  46. struct nfsd3_createargs {
  47.     struct svc_fh        fh;
  48.     char *            name;
  49.     int            len;
  50.     int            createmode;
  51.     struct iattr        attrs;
  52.     __u32 *            verf;
  53. };
  54.  
  55. struct nfsd3_mknodargs {
  56.     struct svc_fh        fh;
  57.     char *            name;
  58.     int            len;
  59.     __u32            ftype;
  60.     __u32            major, minor;
  61.     struct iattr        attrs;
  62. };
  63.  
  64. struct nfsd3_renameargs {
  65.     struct svc_fh        ffh;
  66.     char *            fname;
  67.     int            flen;
  68.     struct svc_fh        tfh;
  69.     char *            tname;
  70.     int            tlen;
  71. };
  72.  
  73. struct nfsd3_linkargs {
  74.     struct svc_fh        ffh;
  75.     struct svc_fh        tfh;
  76.     char *            tname;
  77.     int            tlen;
  78. };
  79.  
  80. struct nfsd3_symlinkargs {
  81.     struct svc_fh        ffh;
  82.     char *            fname;
  83.     int            flen;
  84.     char *            tname;
  85.     int            tlen;
  86.     struct iattr        attrs;
  87. };
  88.  
  89. struct nfsd3_readdirargs {
  90.     struct svc_fh        fh;
  91.     __u32            cookie;
  92.     __u32            dircount;
  93.     __u32            count;
  94.     __u32 *            verf;
  95. };
  96.  
  97. struct nfsd3_commitargs {
  98.     struct svc_fh        fh;
  99.     __u64            offset;
  100.     __u64            count;
  101. };
  102.  
  103. struct nfsd3_attrstat {
  104.     __u32            status;
  105.     struct svc_fh        fh;
  106. };
  107.  
  108. struct nfsd3_lookupres  {
  109.     __u32            status;
  110.     struct svc_fh        dirfh;
  111.     struct svc_fh        fh;
  112. };
  113.  
  114. struct nfsd3_accessres {
  115.     __u32            status;
  116.     struct svc_fh        fh;
  117.     __u32            access;
  118. };
  119.  
  120. struct nfsd3_readlinkres {
  121.     __u32            status;
  122.     struct svc_fh        fh;
  123.     __u32            len;
  124. };
  125.  
  126. struct nfsd3_readres {
  127.     __u32            status;
  128.     struct svc_fh        fh;
  129.     unsigned long        count;
  130.     int            eof;
  131. };
  132.  
  133. struct nfsd3_writeres {
  134.     __u32            status;
  135.     struct svc_fh        fh;
  136.     unsigned long        count;
  137.     int            committed;
  138. };
  139.  
  140. struct nfsd3_createres {
  141.     __u32            status;
  142.     struct svc_fh        dirfh;
  143.     struct svc_fh        fh;
  144. };
  145.  
  146. struct nfsd3_renameres {
  147.     __u32            status;
  148.     struct svc_fh        ffh;
  149.     struct svc_fh        tfh;
  150. };
  151.  
  152. struct nfsd3_linkres {
  153.     __u32            status;
  154.     struct svc_fh        tfh;
  155.     struct svc_fh        fh;
  156. };
  157.  
  158. struct nfsd3_readdirres {
  159.     __u32            status;
  160.     struct svc_fh        fh;
  161.     __u32 *            list_end;
  162. };
  163.  
  164. struct nfsd3_statfsres {
  165.     __u32            status;
  166.     struct statfs        stats;
  167.     __u32            invarsec;
  168. };
  169.  
  170. struct nfsd3_fsinfores {
  171.     __u32            status;
  172.     __u32            f_rtmax;
  173.     __u32            f_rtpref;
  174.     __u32            f_rtmult;
  175.     __u32            f_wtmax;
  176.     __u32            f_wtpref;
  177.     __u32            f_wtmult;
  178.     __u32            f_dtpref;
  179.     __u64            f_maxfilesize;
  180.     __u32            f_properties;
  181. };
  182.  
  183. struct nfsd3_pathconfres {
  184.     __u32            status;
  185.     __u32            p_link_max;
  186.     __u32            p_name_max;
  187.     __u32            p_case_insensitive;
  188.     __u32            p_case_preserving;
  189. };
  190.  
  191. struct nfsd3_commitres {
  192.     __u32            status;
  193.     struct svc_fh        fh;
  194. };
  195.  
  196. /* dummy type for release */
  197. struct nfsd3_fhandle2 {
  198.     __u32            dummy;
  199.     struct svc_fh        fh1;
  200.     struct svc_fh        fh2;
  201. };
  202.  
  203. /*
  204.  * Storage requirements for XDR arguments and results.
  205.  */
  206. union nfsd3_xdrstore {
  207.     struct nfsd3_sattrargs        sattrargs;
  208.     struct nfsd3_diropargs        diropargs;
  209.     struct nfsd3_readargs        readargs;
  210.     struct nfsd3_writeargs        writeargs;
  211.     struct nfsd3_createargs        createargs;
  212.     struct nfsd3_renameargs        renameargs;
  213.     struct nfsd3_linkargs        linkargs;
  214.     struct nfsd3_symlinkargs    symlinkargs;
  215.     struct nfsd3_readdirargs    readdirargs;
  216.     struct nfsd3_lookupres         lookupres;
  217.     struct nfsd3_accessres        accessres;
  218.     struct nfsd3_readlinkres    readlinkres;
  219.     struct nfsd3_readres        readres;
  220.     struct nfsd3_writeres        writeres;
  221.     struct nfsd3_createres        createres;
  222.     struct nfsd3_renameres        renameres;
  223.     struct nfsd3_linkres        linkres;
  224.     struct nfsd3_readdirres        readdirres;
  225.     struct nfsd3_statfsres        statfsres;
  226.     struct nfsd3_fsinfores        fsinfores;
  227.     struct nfsd3_pathconfres    pathconfres;
  228.     struct nfsd3_commitres        commitres;
  229. };
  230.  
  231. #define NFS3_SVC_XDRSIZE        sizeof(union nfsd3_xdrstore)
  232.  
  233. void nfsxdr_init(void);
  234.  
  235. int nfs3svc_decode_fhandle(struct svc_rqst *, u32 *, struct svc_fh *);
  236. int nfs3svc_decode_sattr3args(struct svc_rqst *, u32 *,
  237.                 struct nfsd3_sattrargs *);
  238. int nfs3svc_decode_dirop3args(struct svc_rqst *, u32 *,
  239.                 struct nfsd3_diropargs *);
  240. int nfs3svc_decode_read3args(struct svc_rqst *, u32 *,
  241.                 struct nfsd3_readargs *);
  242. int nfs3svc_decode_write3args(struct svc_rqst *, u32 *,
  243.                 struct nfsd3_writeargs *);
  244. int nfs3svc_decode_create3args(struct svc_rqst *, u32 *,
  245.                 struct nfsd3_createargs *);
  246. int nfs3svc_decode_rename3args(struct svc_rqst *, u32 *,
  247.                 struct nfsd3_renameargs *);
  248. int nfs3svc_decode_link3args(struct svc_rqst *, u32 *,
  249.                 struct nfsd3_linkargs *);
  250. int nfs3svc_decode_symlink3args(struct svc_rqst *, u32 *,
  251.                 struct nfsd3_symlinkargs *);
  252. int nfs3svc_decode_readdir3args(struct svc_rqst *, u32 *,
  253.                 struct nfsd3_readdirargs *);
  254. int nfs3svc_encode_readlinkres(struct svc_rqst *, u32 *,
  255.                 struct nfsd3_readlinkres *);
  256. int nfs3svc_encode_readres(struct svc_rqst *, u32 *, struct nfsd3_readres *);
  257. int nfs3svc_encode_statfsres(struct svc_rqst *, u32 *,
  258.                 struct nfsd3_statfsres *);
  259. int nfs3svc_encode_readdirres(struct svc_rqst *, u32 *,
  260.                 struct nfsd3_readdirres *);
  261. int nfs3svc_release_fhandle(struct svc_rqst *, u32 *,
  262.                 struct nfsd_fhandle *);
  263. int nfs3svc_release_fhandle2(struct svc_rqst *, u32 *,
  264.                 struct nfsd3_fhandle2 *);
  265. int nfs3svc_encode_entry(struct readdir_cd *, const char *name,
  266.                 int namlen, unsigned long offset, ino_t ino);
  267.  
  268. #endif /* LINUX_NFSD_XDR3_H */
  269.